package com.study.order.controller;

import com.study.order.dto.MessageDTO;
import com.study.order.service.OrderService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 生产者
 * @author: chenguanmin
 * @date: 2023-09-22  17:54
 **/
@RestController
@RequestMapping("/test")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class OrderController {

    private final OrderService orderService;

    @PostMapping("/syncMessage")
    public void sendSyncMessage(@RequestBody MessageDTO dto) {
        orderService.sendSyncMessage(dto);
    }
}
